package com.hhit.yb.compose_demo.views.basic

import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.lazy.staggeredgrid.LazyVerticalStaggeredGrid
import androidx.compose.foundation.lazy.staggeredgrid.StaggeredGridCells
import androidx.compose.runtime.Composable
import androidx.compose.ui.unit.dp
import com.hhit.yb.compose_demo.models.snacks

/**
 * 瀑布流列表
 */
@Composable
fun FlowList() {
    LazyVerticalStaggeredGrid(
        columns = StaggeredGridCells.Fixed(2),
        verticalItemSpacing = 8.dp,
        horizontalArrangement = Arrangement.spacedBy(8.dp)
    ) {
        items(snacks.size) {
            GridSnackCardWithTitle(snack = snacks[it])
        }
    }
}